<template>
  <div>
    <a :href="link" :title="title" :alt="title">百度</a>
    <button @click="add">{{ count }}</button>
    <button @click="add2(5)">{{ count }}</button>

    <hr />
    <a :href="link" @click.prevent>百度</a>
    <hr />
    <div class="ff" @click="ff">
      <div class="ss" @click.stop="ss"></div>
    </div>
    <hr />
    <input type="text" @keyup.enter="ke">
  </div>
</template>

<script>
export default {
  data() {
    return {
      link: "http://www.baidu.com/",
      title: "我是百度",
      count: 0,
    };
  },
  methods: {
    add() {
      this.count++;
    },
    add2(s) {
      this.count += s;
    },
    fn(e) {
      e.preventDefault();
      console.log(e);
    },
    ff() {
      console.log("我是你爹");
    },
    ss() {
      console.log("好家伙");
    },
    ke() {
      console.log("触发了");
    },
  },
};
</script>

<style scoped lang="less">
.ff {
  width: 100px;
  height: 100px;
  background: #000;
  overflow: hidden;
  .ss {
    width: 50px;
    height: 50px;
    background: rgb(141, 109, 109);
    margin: 25px;
  }
}
</style>
